<template>
  <div>
    <div>
      <van-sidebar v-model="activeKey">
        <van-sidebar-item
          v-for="hh in list"
          :title="hh.name"
          :key="hh.cateid"
          ref="chuan"
          @click="click"
        />
      </van-sidebar>

      <Home1></Home1>
    </div>

    <div>
      <div class="listright">
        <div class="pro">
          <div class="title">
            {{ name2 }}
            <img
              src="https://static.epetbar.com/static_wap/appmall/lib/goods/cate_right_img.png"
            />
          </div>
          <ul class="product">
            <li v-for="tit in namelist" :key="tit.id_param">
              <img :src="tit.photo" />
              <p>{{ tit.name }}</p>
            </li>
          </ul>
        </div>
        <div class="brand">
          <div class="brandtitle">热门品牌</div>
          <ul class="brandlist">
            <li v-for="hot in hotlist" :key="hot.param">
              <div class="imgdiv">
                <img :src="hot.logo" />
              </div>
              <p>{{ hot.name }}</p>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Icon, List } from "vant";
// import axios from "axios";
import { Sidebar, SidebarItem } from "vant";
import axios from "axios";
import Home1 from "./Home1.vue";

Vue.use(Sidebar);
Vue.use(SidebarItem);
Vue.use(Icon);
export default {
  components: {
    Listright,
    Home1,
  },
};
</script>

<style lang='stylus' scoped>
.listright {
  position: fixed;
  top: 0.4rem;
  bottom: 0.52rem;
  flex: 1;
  background-color: #fff;
  margin-left: 0.75rem;
  border-top: 0.05rem solid #f3f4f5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  right: 0;
  overflow-y: scroll;
  left: 0.01rem;
}

.pro {
  padding: 0.05rem 0.05rem 0.2rem;
  color: #999;
  font-size: 0.12rem;
  border-bottom: 1px solid #f0f0f0;
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.1rem 0 0;

  img {
    height: 0.1rem;
    width: 0.46rem;
  }
}

.product {
  font-size: 0.14rem;
  display: flex;
  padding-top: 0.15rem;

  li {
    width: 33%;
    text-align: center;
    color: #000;
    font-size: 0.13rem;
  }

  img {
    width: 100%;
  }
}

.brandtitle {
  margin-left: 0.1rem;
}

.brand {
  height: 19rem;
  margin: 0.1rem 0 0;
  color: #999;
  font-size: 0.12rem;
}

.brandlist {
  display: flex;
  justify-content: center;
  width: 3rem;
  flex-wrap: wrap;

  li {
    margin: 0.1rem 0 0;
    width: 48%;
    text-align: center;
    color: #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    p {
      width: 100%;
      margin: 0.05rem 0 0;
      text-align: center;
    }

    img {
      height: 0.45rem;
      display: inline-block;
      margin: auto;
      margin-top: 0.04rem;
    }

    .imgdiv {
      // width: 1.35rem;
      width: 94%;
      height: 0.55rem;
      border: 1px solid #f0f0f0;
    }
  }
}

.van-sidebar {
  background-color: #fff;
  width: 0.7rem;
  margin-top: 0.02rem;
  bottom: 0.52rem;
  position: fixed;
  top: 0.4rem;
}

.van-sidebar-item {
  background-color: #fff;
  border-bottom: 1px solid #f3f4f5;
  font-size: 13px;
  height: 0.5rem;
  width: 0.7rem;
  padding: 0 0;
  text-align: center;
  line-height: 0.5rem;
}

.van-sidebar-item--select {
  background-color: #f3f4f5;
  color: #41C856;
}

.van-sidebar-item--select::before {
  background: rgba(255, 255, 255, 0);
}
</style>